import axios from 'axios'

const baseUrl = 'http://192.168.88.177:9875'

// /api/v1/dataDashboard/getYears
export const getYears = () => {
  const url = baseUrl + '/api/v1/dataDashboard/getYears'
  return axios.get(url)
}

export const getHetongContent = (year) => {
  const url = baseUrl + '/api/v1/dataDashboard/getContractCountAndAmountByYear'
  return axios.get(url, { params: { year } })
}

// /api/v1/dataDashboard/getContractCountChangeByYear
export const getHetongContentChange = (year) => {
  const url = baseUrl + '/api/v1/dataDashboard/getContractCountChangeByYear'
  return axios.get(url, { params: { year } })
}

// /api/v1/dataDashboard/getProductionAmount
export const getProductionAmount = (year) => {
  const url = baseUrl + '/api/v1/dataDashboard/getProductionAmount'
  return axios.get(url, { params: { year } })
}

// /api/v1/dataDashboard/getMonthProductionAmount
export const getMonthProductionAmount = (year) => {
  const url = baseUrl + '/api/v1/dataDashboard/getMonthProductionAmount'
  return axios.get(url, { params: { year } })
}

// /api/v1/dataDashboard/getReceiveAmount
export const getReceiveAmount = (year) => {
  const url = baseUrl + '/api/v1/dataDashboard/getReceiveAmount'
  return axios.get(url, { params: { year } })
}

// /api/v1/dataDashboard/getMonthReceiveAmount
export const getMonthReceiveAmount = (year) => {
  const url = baseUrl + '/api/v1/dataDashboard/getMonthReceiveAmount'
  return axios.get(url, { params: { year } })
}

// /api/v1/dataDashboard/getProjectIndex
export const getProjectIndex = (year) => {
  const url = baseUrl + '/api/v1/dataDashboard/getProjectIndex'
  return axios.get(url, { params: { year } })
}

// /api/v1/dataDashboard/getMonthProjectNum
export const getMonthProjectNum = (year) => {
  const url = baseUrl + '/api/v1/dataDashboard/getMonthProjectNum'
  return axios.get(url, { params: { year } })
}

///api/v1/dataDashboard/getContractCountAndAmountForScbk
export const getContractCountAndAmountForScbk = (year) => {
  const url = baseUrl + '/api/v1/dataDashboard/getContractCountAndAmountForScbk'
  return axios.get(url, { params: { year } })
}

// /api/v1/dataDashboard/getContractAmountForYwlx
export const getContractAmountForYwlx = (year, scbk) => {
  const url = baseUrl + '/api/v1/dataDashboard/getContractAmountForYwlx'
  return axios.get(url, { params: { year, scbk } })
}

// /api/v1/dataDashboard/getContractCountForYwlx
export const getContractCountForYwlx = (year, scbk) => {
  const url = baseUrl + '/api/v1/dataDashboard/getContractCountForYwlx'
  return axios.get(url, { params: { year, scbk } })
}

// /api/v1/dataDashboard/getContractMonthAmountForYwlxByScbk
export const getContractMonthAmountForYwlxByScbk = (year, scbk, ywlx) => {
  const url = baseUrl + '/api/v1/dataDashboard/getContractMonthAmountForYwlxByScbk'
  return axios.get(url, { params: { year, scbk, ywlx } })
}

// /api/v1/dataDashboard/getReceiveAmountForScbk
export const getReceiveAmountForScbk = (year) => {
  const url = baseUrl + '/api/v1/dataDashboard/getReceiveAmountForScbk'
  return axios.get(url, { params: { year } })
}

// /api/v1/dataDashboard/getProjectCountAndAmountForScbk
export const getProjectCountAndAmountForScbk = (year) => {
  const url = baseUrl + '/api/v1/dataDashboard/getProjectCountAndAmountForScbk'
  return axios.get(url, { params: { year } })
}

// /api/v1/dataDashboard/getProjectCountForYelxByScbk
export const getProjectCountForYelxByScbk = (year, scbk) => {
  const url = baseUrl + '/api/v1/dataDashboard/getProjectCountForYelxByScbk'
  return axios.get(url, { params: { year, scbk } })
}

// /api/v1/dataDashboard/getProductionAmountForScbk
export const getProductionAmountForScbk = (year) => {
  const url = baseUrl + '/api/v1/dataDashboard/getProductionAmountForScbk'
  return axios.get(url, { params: { year } })
}

// /api/v1/dataDashboard/getReceiveAmountForYelxByScbk
export const getReceiveAmountForYelxByScbk = (year, scbk) => {
  const url = baseUrl + '/api/v1/dataDashboard/getReceiveAmountForYelxByScbk'
  return axios.get(url, { params: { year, scbk } })
}

// /api/v1/dataDashboard/getProductionAmountForYelxByScbk
export const getProductionAmountForYelxByScbk = (year, scbk) => {
  const url = baseUrl + '/api/v1/dataDashboard/getProductionAmountForYelxByScbk'
  return axios.get(url, { params: { year, scbk } })
}

// /api/v1/dataDashboard/getMonthReceiveAmountForYelxByScbk
export const getMonthReceiveAmountForYelxByScbk = (year, scbk, ywlx) => {
  const url = baseUrl + '/api/v1/dataDashboard/getMonthReceiveAmountForYelxByScbk'
  return axios.get(url, { params: { year, scbk, ywlx } })
}

// /api/v1/dataDashboard/getMonthProductionAmountForYelxByScbk
export const getMonthProductionAmountForYelxByScbk = (year, scbk, ywlx) => {
  const url = baseUrl + '/api/v1/dataDashboard/getMonthProductionAmountForYelxByScbk'
  return axios.get(url, { params: { year, scbk, ywlx } })
}

// /api/v1/dataDashboard/getProjectNsfCountForYelxByScbk
export const getProjectNsfCountForYelxByScbk = (year, scbk) => {
  const url = baseUrl + '/api/v1/dataDashboard/getProjectNsfCountForYelxByScbk'
  return axios.get(url, { params: { year, scbk } })
}

//     "zdpt","zdyz","zdxm"
// /api/v1/dataDashboard/getKeyList
export const getKeyList = (data) => {
  const url = baseUrl + '/api/v1/dataDashboard/getKeyList'
  return axios.post(url, data)
}

// /api/v1/dataDashboard/exportKeyResultExcel
export const exportKeyResultExcel = (data) => {
  const url = baseUrl + '/api/v1/dataDashboard/exportKeyResultExcel'
  return axios.post(
    url,
    data,
    { responseType: 'blob' },
    { headers: { 'Content-Type': 'application/json' } },
  )
}

// /api/v1/dataDashboard/getUniqueZj
export const getUniqueZj = () => {
  const url = baseUrl + '/api/v1/dataDashboard/getUniqueZj'
  return axios.get(url)
}

// /api/v1/dataDashboard/getProjectIndexForYwlxAndYwhjByTown
export const getProjectIndexForYwlxAndYwhjByTown = (year, townName) => {
  const url = baseUrl + '/api/v1/dataDashboard/getProjectIndexForYwlxAndYwhjByTown'
  return axios.get(url, { params: { year, townName } })
}

// /api/v1/dataDashboard/getUniqueScbk
export const getUniqueScbk = (year) => {
  const url = baseUrl + '/api/v1/dataDashboard/getUniqueScbk'
  return axios.get(url, { params: { year } })
}

// /api/v1/dataDashboard/getUniqueYwlxByScbk
export const getUniqueYwlxByScbk = (year, scbk) => {
  const url = baseUrl + '/api/v1/dataDashboard/getUniqueYwlxByScbk'
  return axios.get(url, { params: { year, scbk } })
}

// /api/v1/dataDashboard/getContractAmountChangeByYear
export const getContractAmountChangeByYear = (year) => {
  const url = baseUrl + '/api/v1/dataDashboard/getContractAmountChangeByYear'
  return axios.get(url, { params: { year } })
}

// /api/v1/dataDashboard/getReceiveAmountChangeByYear
export const getReceiveAmountChangeByYear = (year) => {
  const url = baseUrl + '/api/v1/dataDashboard/getReceiveAmountChangeByYear'
  return axios.get(url, { params: { year } })
}

// /api/v1/dataDashboard/getProductionAmountChangeByYear
export const getProductionAmountChangeByYear = (year) => {
  const url = baseUrl + '/api/v1/dataDashboard/getContractAmountChangeByYear'
  return axios.get(url, { params: { year } })
}

// /api/v1/dataDashboard/getMonthProjectCaseCount
export const getMonthProjectCaseCount = (year) => {
  const url = baseUrl + '/api/v1/dataDashboard/getMonthProjectCaseCount'
  return axios.get(url, { params: { year } })
}

// /api/v1/dataDashboard/getMonthProjectPlannedCharge
export const getMonthProjectPlannedCharge = (year) => {
  const url = baseUrl + '/api/v1/dataDashboard/getMonthProjectPlannedCharge'
  return axios.get(url, { params: { year } })
}
